package com.team.olympic.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.team.olympic.pojo.Response;
import com.team.olympic.service.ItemService;

@CrossOrigin
@RestController
public class ItemController {
    @Autowired
    private ItemService itemService;

    @GetMapping("/items")
    public Response<?> findAllItems() {
        return Response.success(itemService.findAllItems());
    }

    @GetMapping("/itemRecord")
    public Response<?> findAllRecord() {
        return Response.success(itemService.findAllRecord());
    }
}
